package com.share.innerclass;

/**
 * 
 * @author Johnny Tam
 *	
 *	局部内部类
 *
 */
public class Outer3 {
	int var1 = 1;	
	
	public void fun(int parm) {
		int var2 = 2;		
		System.out.println("call fun =>");
		class Inner2 {
			int var3 = 3;
			int var4 = var1 + var3;
			//static int var5 = 0;//不允许static
			
			int var6 = parm;
		
			void printVar() {
				System.out.println("var4 = " + var4);
				System.out.println("var6 = " + var6);
			}
		}
		//实例化局部内部类
		Inner2 tempInner2 = new Inner2();
		System.out.println("call Inner2's fun =>");
		tempInner2.printVar();
		
		System.out.println("方法fun内部类： " + var2);
	}
	
	//Inner2 inner2_2 = new Inner2();//error
	
	
}
